package com.blog.blogservice.util;

import org.springframework.stereotype.Component;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author guanglin.ma
 * @date 2024-03-03 14:48
 */
@Component
public class ReadMdUtil {

    public static String readMd(){
        String filePath = "C:\\Users\\MGL\\Desktop\\Skywalking.md";
        StringBuilder markdownContent = new StringBuilder();

        try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
            String line;
            while ((line = br.readLine()) != null) {
                markdownContent.append(line).append(System.lineSeparator());
            }

            return markdownContent.toString();

        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
